home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
FORTGAME.DIR
/
00276_Script_Inventory
< prev
next >
Wrap
Text File
|
1996-03-20
|
3KB
|
104 lines
on acquireObject objectName
global item1Sprite, item2Sprite, item3Sprite
global item1Name, item2Name, item3Name
if item1Name = empty then
set item1Name = "inventoryItem "&objectName
puppetSprite item1Sprite, true
set the castNum of sprite item1Sprite = the number of cast item1Name
setGrabObjectCursor item1Sprite
else if item2Name = empty then
set item2Name = "inventoryItem "&objectName
puppetSprite item2Sprite, true
set the castNum of sprite item2Sprite = the number of cast item2Name
setGrabObjectCursor item2Sprite
else if item3Name = empty then
set item3Name = "inventoryItem "&objectName
puppetSprite item3Sprite, true
set the castNum of sprite item3Sprite = the number of cast item3Name
setGrabObjectCursor item3Sprite
else
return false
end if
resetSpriteCursor (the clickOn)
return true
end acquireObject
on ClickInventoryItem whichSprite
global currentList, currentListLine
put getFrameFromListLine (currentList, currentListLine) into currentPos
if (currentpos = "R 7") and (objectInInventory ("BackwardNote") = whichSprite) then
useObject whichSprite
dissolve 2
go "Reveal Backward Note"
end if
if (currentpos = "R 9") and (objectInInventory ("Snorkel1") = whichSprite) then
useObject whichSprite
dissolve 2
go "Attach Snorkel"
end if
if (currentpos = "A 3 D") and (objectInInventory ("Key1") = whichSprite) then
useObject whichSprite
UnlockDoor 3
OpenDoor 3
end if
if (currentpos = "B 7 D") and (objectInInventory ("Key2") = whichSprite) then
useObject whichSprite
UnlockDoor 7
OpenDoor 7
end if
if (currentpos = "R 13") and (objectInInventory ("Key3") = whichSprite) then
useObject whichSprite
global trunkOpen
set trunkOpen = true
rPlaySound "Trunk"
go frame "TrunkOpen"
WaitSound
end if
if (currentpos = "C 23 D") and (objectInInventory ("Key4") = whichSprite) then
useObject whichSprite
UnlockDoor 23
OpenDoor 23
end if
end ClickInventoryItem
on useObject whichSprite
set the castNum of sprite whichSprite = emptyCastNumber()
global item1Sprite, item2Sprite, item3Sprite
global item1Name, item2Name, item3Name
if whichSprite = item1Sprite then
set item1Name = empty
resetSpriteCursor item1Sprite
else if whichSprite = item2Sprite then
set item2Name = empty
resetSpriteCursor item2Sprite
else if whichSprite = item3Sprite then
set item3Name = empty
resetSpriteCursor item3Sprite
end if
end useObject
on objectInInventory objectName
-- returns 0 if not found, else returns sprite number
global item1Sprite, item2Sprite, item3Sprite
global item1Name, item2Name, item3Name
if item1Name = "InventoryItem "&objectName then
return item1Sprite
else if item2Name = "InventoryItem "&objectName then
return item2Sprite
else if item3Name = "InventoryItem "&objectName then
return item3Sprite
else
return false
end if
end objectInInventory